package gemini.castor.ui.server.service.impl;

import gemini.basic.exception.IdentityExistedException;
import gemini.basic.manager.PersonManager;
import gemini.basic.model.Person;
import gemini.castor.ui.client.service.PersonService;
import gemini.castor.ui.server.service.AbstractSingleService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class PersonServiceImpl extends
        AbstractSingleService<PersonManager> implements
        PersonService {

    @SuppressWarnings("unused")
	private final Log logger = LogFactory
            .getLog(PersonServiceImpl.class);

    public Person saveOrUpdate(Person person) throws IdentityExistedException{
    	Person result = duplicateExcludeFields(getServerManager().saveOrUpdate(person));
    	return result;
    }
    
    @Override
	public Person getById(int id) {
    	Person result = duplicateExcludeFields(getServerManager().getById(id));
    	return result;
	}
}
